<%@ page pageEncoding="utf-8"%>
<%@ include file="/common/taglibs.jsp"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title><fmt:message key="vipServiceReceivecarList.title"/></title> 
<link rel="stylesheet" type="text/css" media="all"	href="<c:url value='/styles/layout.css'/>" />
<script src="<c:url value="/scripts/datetime.js"/>" language="javascript"></script>


<script language="JavaScript" type="text/JavaScript">
<!--
function MM_goToURL() { //v3.0
  var i, args=MM_goToURL.arguments; document.MM_returnValue = false;
  for (i=0; i<(args.length-1); i+=2) eval(args[i]+".location='"+args[i+1]+"'");
}
//-->
</script>
</head>

<body leftmargin="0" topmargin="0">

<table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">
  <tr>
    <td height="44" class="home-content-title"><img src="images/home_ico_listTitle.gif" width="22" height="20" align="absmiddle">更新车辆接机信息</td>
  </tr>
  <logic:messagesPresent>
		<tr id="messagesPresentTrId" style="display:;">
			<td valign="top" class="black12" height="20">
				<table width="100%" border="0" cellspacing="0" cellpadding="0" align="center">
					<tr>
						<td class="arror_bg">
							<span class="arror_title">
						     您的操作存在如下错误：<br></span>
						     <html:errors/>
					    </td>
				    </tr>
			    </table>
			</td>
		</tr>
   </logic:messagesPresent>
   <!-- add by ewen for datetime compaire -->
   <tr id="msgShowForTimeCheck" style="display:none;">
	<td valign="top" class="black12">
	<table width="100%" border="0" cellspacing="0" cellpadding="0" align="center">
	<tr>
	<td class="arror_bg">
	<span class="arror_title"> 
     您的操作存在如下错误：<br/>
     </span>
     <span id="errorReCarTime" style="display:none;">
      <li>操作时间不能大于航班预计起飞时间 <span id="etdTime"></span>
     </span>
    </td>
    </tr>
    </table>
	</td>
	</tr>
    <!-- end datetime compaire -->
  <tr id="messageShowTrId" style="display:none;">
	<td valign="top" class="black12">
	<table width="100%" border="0" cellspacing="0" cellpadding="0" align="center">
	<tr>
	<td class="arror_bg_s">
	<span class="arror_title_s"> 
        保存信息成功!<br/>
     </span>
    </td>
    </tr>
    </table>
	</td>
	</tr>
  <tr>
    <td height="30" class="home-search-space">&nbsp;<fmt:message key="common.warning"/></td>
  </tr>
  
  
  <tr>
    <td valign="top"> 
      <table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">
        <tr> 
          <td class="home-table-topline"> </td>
        </tr>
        <tr> 
          <td class="home-table-leftline"><table width="100%" border="0" cellspacing="0" cellpadding="0">
              <tr> 
                <td class="home-table-tool-content">
			 <%--<html:button styleClass="home-inputBtn" property="method.save" onclick="doCommit()">保存
            			
			</html:button>--%>
			
				<input type="button" class="home-inputBtn" onclick="doCommit()" value="保存"
				<logic:messagesNotPresent>
			       <c:if test="${('savesubmit' eq param.method)  || ('2' eq param.type)}">disabled</c:if> 
			    </logic:messagesNotPresent>    
			       />
			
			<html:reset styleClass="home-inputBtn" onclick="doReset()">重置 
			</html:reset>
		   
		    <input type="button" class="home-inputBtn"  onclick="doSubmit()" value="保存并提交"
		    <logic:messagesNotPresent>
			 <c:if test="${('savesubmit' eq param.method)  || ('2' eq param.type)}">disabled</c:if>
			</logic:messagesNotPresent> 
			 />
			
        		
		</td>
              </tr>
              
              <tr>
                 <td align="center" valign="top">
                   <c:import url="../../../vipServiceSheet.html?method=view&isInclude=yes&id=${vipServiceReceivecarForm.vipServiceSheetId}"/></td>
                
              </tr>  
             <tr> 
                <td valign="top" class="home-edittable-space"> <table width="100%" border="0" cellspacing="0" cellpadding="0">
                    <html:form action="vipServiceReceivecar" method="post" styleId="vipServiceReceivecarForm">
						<html:hidden property="id"/>
                        <html:hidden property="vipServiceSheetId"/>
               <tr> 
                      <td class="home-table-tool-content">接机车辆安排情况记录</td>
                    </tr>
                    <tr>
     
                      <td><table width="100%" border="0" cellpadding="4" cellspacing="1" class="home-subtable-bgcolor">
                          <tr> 
                            <td width="20%" class="home-subtable-view-tdstyle-right"><font color="red">*</font>时间：</td>
                            <td class="home-subtable-view-tdstyle-left"><html:text property="receivedCarTime" styleId="receivedCarTime" styleClass="home-table-inputbox" 
			                    readonly="false" />
			                    <img src="images/date.gif" border="0" onclick="fPopCalendar(receivedCarTime,receivedCarTime);return false"></td>
		                    <td class="home-subtable-view-tdstyle-right">联系方式：</td>
                            <td class="home-subtable-view-tdstyle-left"><html:text property="receivedCarLinkman" styleId="receivedCarLinkman" styleClass="home-table-inputbox"/></td>   
                            <!-- 
                            <td width="20%" class="home-subtable-view-tdstyle-right"><font color="red">*</font>地点：</td>
                            <td class="home-subtable-view-tdstyle-left"><html:text property="receivedCarLocator" styleId="receivedCarLocator" styleClass="home-table-inputbox" /></td>
                             -->
                          </tr>
                          <tr> 
                            <td class="home-subtable-view-tdstyle-right"><font color="red">*</font>司机：</td>
                            <td class="home-subtable-view-tdstyle-left"><html:text property="receivedCarDriver" styleId="receivedCarDriver" styleClass="home-table-inputbox" /></td>
                            <td class="home-subtable-view-tdstyle-right"><font color="red">*</font>车牌：</td>
                            <td class="home-subtable-view-tdstyle-left"><html:text property="receivedCarLicense" styleId="receivedCarLicense" styleClass="home-table-inputbox" /></td>
                          </tr>
                          <tr> 
                            <td class="home-subtable-view-tdstyle-right"><font color="red">*</font>出发站：</td>
                            <td class="home-subtable-view-tdstyle-left"><html:text property="receivedCarOrigin" styleId="receivedCarOrigin" styleClass="home-table-inputbox"/></td>
                            <td class="home-subtable-view-tdstyle-right"><font color="red">*</font>终点站：</td>
                            <td class="home-subtable-view-tdstyle-left"><html:text property="receivedCarEnd" styleId="receivedCarEnd" styleClass="home-table-inputbox"/></td>
                          </tr>
                        </table></td>
                    </tr>
                  </table> 
                </td>
              </tr>
            </table>
		  </td>
        </tr>
        <tr> 
          <td height="12">
		<table width="100%" border="0" cellspacing="0" cellpadding="0">
              <tr> 
                <td class="home-table-bottom-left">&nbsp;</td>
                <td class="home-table-bottom-bg">&nbsp;</td>
                <td class="home-table-bottom-right">&nbsp;</td>
              </tr>
            </table></td>
        </tr>
      </table>
	  </td>
  </tr>
  <tr>
    <td height="10">&nbsp;</td>
  </tr>
</table>
</html:form>
<script>
	function doCommit(){
	   if(timeCheck()){
		vipServiceReceivecarForm.method="post";
	    vipServiceReceivecarForm.action="vipServiceReceivecar.html?method=save&processinstid=<c:out value="${param.processinstid}"/>&workItemId=<c:out value="${param.workItemId}"/>&appId=<c:out value="${param.appId}"/>&vipServiceSheetId=<c:out value="${param.vipServiceSheetId}"/>";
		vipServiceReceivecarForm.submit();
		}
	   return;
	}
		function doSubmit(){
		if(timeCheck()){
		vipServiceReceivecarForm.method="post";
		vipServiceReceivecarForm.action="vipServiceReceivecar.html?method=savesubmit&processinstid=<c:out value="${param.processinstid}"/>&workItemId=<c:out value="${param.workItemId}"/>&appId=<c:out value="${param.appId}"/>&vipServiceSheetId=<c:out value="${param.vipServiceSheetId}"/>";
		vipServiceReceivecarForm.submit();
		}
		 return;
	}
	function doCancel(){
		vipServiceReceivecarForm.method="post";
		vipServiceReceivecarForm.action="vipServiceReceivecar.html";
		vipServiceReceivecarForm.submit();
	}
	function doReset(){
       document.vipServiceReceivecarForm.reset()

	}
	
	function timeCheck(){
	   var msgShowForTimeCheck=document.getElementById("msgShowForTimeCheck");
	   var errorReCarTime=document.getElementById("errorReCarTime");
	   var etdTime=document.getElementById("etdTime");
	   var etd=document.getElementById("etd");
	   var receivedCarTime=document.getElementById("receivedCarTime");
	   var messagesPresentTrId=document.getElementById("messagesPresentTrId");
	   var messageShowTrIdTd=document.getElementById("messageShowTrId");
	   
	   var re=/-/g; 
	   var etdStr=etd.value.replace(re,"/").substring(0,16);
	   var receivedCarTimeStr=receivedCarTime.value.replace(re,"/").substring(0,16);
	   var etdDateTime=new Date(etdStr);
	   var receivedCarDateTime=new Date(receivedCarTimeStr);
	   //alert(etdStr+"::"+receivedCarTimeStr);
	   var df=(etdDateTime.getTime()-receivedCarDateTime.getTime())/1000/60;
	   //alert(df);
	   if(receivedCarTimeStr=="")df=1;
	   if(df>0)return true;
	   
	   if(msgShowForTimeCheck!=null)
	   msgShowForTimeCheck.style.display="";
	   if(errorReCarTime!=null)
	   errorReCarTime.style.display="";
	   etdTime.innerText=etd.value.substring(0,16);
	   if(messagesPresentTrId!=null)
	   messagesPresentTrId.style.display="none";
	   if(messageShowTrIdTd!=null)
	   messageShowTrIdTd.style.display="none";
	   return false;
	}
	
</script>
</body>
</html>
<script>
//保存信息处理 add by kellen
if("1"=='<c:out value="${flag}"/>'){
	//alert("保存信息成功!");
	var messageShowTrIdTd=document.getElementById("messageShowTrId");
	messageShowTrIdTd.style.display="";
	//window.location=window.location;  
}else if("-1"=='<c:out value="${flag}"/>'){
	alert("保存信息失败!");
	 
}else if("2" ==  '<c:out value="${flag}"/>'){
	//window.location=window.location;  
}
</script>

